home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3c / getcwd.z / getcwd
Encoding:
Text File  |  2002-10-03  |  5.1 KB  |  133 lines

  1.  
  2.  
  3.  
  4. ggggeeeettttccccwwwwdddd((((3333CCCC))))                                                          ggggeeeettttccccwwwwdddd((((3333CCCC))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      _gggg_eeee_tttt_cccc_wwww_dddd - get pathname of current working directory
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_uuuu_nnnn_iiii_ssss_tttt_dddd_...._hhhh_>>>>
  13.  
  14.      _cccc_hhhh_aaaa_rrrr _****_gggg_eeee_tttt_cccc_wwww_dddd _((((_cccc_hhhh_aaaa_rrrr _****_bbbb_uuuu_ffff_,,,, _ssss_iiii_zzzz_eeee______tttt _ssss_iiii_zzzz_eeee_))))_;;;;
  15.  
  16. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  17.      _gggg_eeee_tttt_cccc_wwww_dddd returns a pointer to the current directory pathname.  The value of
  18.      _s_i_z_e must be at least one greater than the length of the pathname to be
  19.      returned.
  20.  
  21.      If _b_u_f is not _NNNN_UUUU_LLLL_LLLL, the pathname will be stored in the space pointed to
  22.      by _b_u_f.
  23.  
  24.      If _b_u_f is a _NNNN_UUUU_LLLL_LLLL pointer, _gggg_eeee_tttt_cccc_wwww_dddd will obtain _s_i_z_e bytes of space using
  25.      _mmmm_aaaa_llll_llll_oooo_cccc(3C).  In this case, a subsequent call to _ffff_rrrr_eeee_eeee should be made using
  26.      the pointer returned by _gggg_eeee_tttt_cccc_wwww_dddd as the argument. If _s_i_z_e is less than
  27.      zero, then _gggg_eeee_tttt_cccc_wwww_dddd will obtain an appropriate amount of space.  Passing a
  28.      negative _s_i_z_e and a non-NULL _b_u_f argument will lead to undefined results.
  29.  
  30.      _gggg_eeee_tttt_cccc_wwww_dddd will fail if one or more of the following are true:
  31.  
  32.      _EEEE_AAAA_CCCC_CCCC_EEEE_SSSS      A parent directory cannot be read to get its name.
  33.  
  34.      _EEEE_IIII_NNNN_VVVV_AAAA_LLLL      _s_i_z_e is equal to 0.
  35.  
  36.      _EEEE_RRRR_AAAA_NNNN_GGGG_EEEE      _s_i_z_e is less than the length of the pathname plus 1.
  37.  
  38. EEEEXXXXAAAAMMMMPPPPLLLLEEEE
  39.      Here is a program that prints the current working directory.
  40.  
  41.           _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_uuuu_nnnn_iiii_ssss_tttt_dddd_...._hhhh_>>>>
  42.           _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_tttt_dddd_iiii_oooo_...._hhhh_>>>>
  43.  
  44.           _mmmm_aaaa_iiii_nnnn_((((_))))
  45.           _{{{{
  46.                _cccc_hhhh_aaaa_rrrr _****_cccc_wwww_dddd_;;;;
  47.                _iiii_ffff _((((_((((_cccc_wwww_dddd _==== _gggg_eeee_tttt_cccc_wwww_dddd_((((_NNNN_UUUU_LLLL_LLLL_,,,, _6666_4444_))))_)))) _====_==== _NNNN_UUUU_LLLL_LLLL_))))
  48.                _{{{{
  49.                     _pppp_eeee_rrrr_rrrr_oooo_rrrr_((((_""""_pppp_wwww_dddd_""""_))))_;;;;
  50.                     _eeee_xxxx_iiii_tttt_((((_2222_))))_;;;;
  51.                _}}}}
  52.                _((((_vvvv_oooo_iiii_dddd_))))_pppp_rrrr_iiii_nnnn_tttt_ffff_((((_""""_%%%%_ssss_\\\\_nnnn_""""_,,,, _cccc_wwww_dddd_))))_;;;;
  53.                _ffff_rrrr_eeee_eeee_((((_cccc_wwww_dddd_))))_;;;;
  54.                _rrrr_eeee_tttt_uuuu_rrrr_nnnn_((((_0000_))))_;;;;
  55.           _}}}}
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. ggggeeeettttccccwwwwdddd((((3333CCCC))))                                                          ggggeeeettttccccwwwwdddd((((3333CCCC))))
  71.  
  72.  
  73.  
  74. SEE ALSO
  75.      _mmmm_aaaa_llll_llll_oooo_cccc(3C).
  76.  
  77. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  78.      Returns _NNNN_UUUU_LLLL_LLLL with _eeee_rrrr_rrrr_nnnn_oooo set if _s_i_z_e is not large enough, or if an error
  79.      occurs in a lower-level function.
  80.  
  81. NNNNOOOOTTTTEEEESSSS
  82.      _gggg_eeee_tttt_cccc_wwww_dddd uses the end part of the buffer ( _b_u_f + _s_i_z_e - 1) as temporary
  83.      space.  Be sure that the _s_i_z_e argument accurately reflects the space
  84.      allocated to the buffer.
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.